import http from './axios';

// 封装常用的 HTTP 方法
const request = (method, url, data = null) => {
  return http({
    method,
    url,
    data
  });
};

// GET 请求
export const get = (url, params = {}) => {
  return request('get', url, params);
};

// POST 请求
export const post = (url, data = {}) => {
  return request('post', url, data);
};

// PUT 请求
export const put = (url, data = {}) => {
  return request('put', url, data);
};

// DELETE 请求
export const del = (url, params = {}) => {
  return request('delete', url, params);
};